import request from '@/utils/request'

const service = window.CONFIG.services.admin + '/customer/segmentation'

// 查询【客户分群】列表
export function queryCustomerSegList(data) {
  return request({
    url: service+'/queryCustomerSegList',
    method: 'post',
    data,
  })
}

// 获取分群规则枚举
export function queryTagInfo(data) {
  return request({
    url: service+'/queryTagInfo',
    method: 'post',
    data,
  })
}

export function queryBasicTagInfo(data) {
  return request({
    url: service+'/queryBasicTagInfo',
    method: 'post',
    data,
  })
}

//新增分群规则
export function addCustomerSegInfo(data) {
  return request({
    url: service+'/addCustomerSegInfo',
    method: 'post',
    data,
  })
}

//编辑
export function queryCustomerSegInfo(data) {
  return request({
    url: service+'/queryCustomerSegInfo',
    method: 'post',
    data,
  })
}

//删除
export function deleteCustomerSegInfo(data) {
  return request({
    url: service+'/deleteCustomerSegInfo',
    method: 'post',
    data,
  })
}

// //新增分群规则
// export function addCustomerSegInfo(data) {
//   return request({
//     url: service+'/addCustomerSegInfo',
//     method: 'post',
//     data,
//   })
// }

// 创建人
export function permission(data) {
  return request({
      url: '/admin/permission',
      method: 'post',
      data,
  })
}

// 自动更新
export function caculation(data) {
  return request({
      url: service+ '/caculation',
      method: 'post',
      data,
  })
}

//获取省份枚举值
export function getProvinceList(query) {
  return request({
    url: '/admin/common/queryProvincial',
    method: 'post',
    query,
  })
}

export function getCityList(query) {
  return request({
    url: '/admin/common/queryCity',
    method: 'post',
    query,
  })
}

export function getRiskList(query) {
  return request({
    url: '/admin/common/queryRiskApp',
    method: 'post',
    query,
  })
}
